home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 223_01 / write.c < prev    next >
Text File  |  1980-01-01  |  768b  |  32 lines

  1. /*
  2. ** write.c    by F. A. Scacchitti    11/24/84
  3. */
  4.  
  5. #include <stdio.h>
  6.  
  7. extern int zzbuf;
  8.  
  9. static int i, n;
  10. static char *tbuff, flag;
  11.  
  12. write(fd,buffer,cnt) int fd, cnt; char *buffer; {
  13.  
  14.    tbuff = &zzbuf;
  15.    n = fd + 33;        /* prevents fcb buffer flush */
  16.    *n = NULL;
  17.  
  18.    n=0;
  19.     while(cnt >0){
  20.        i = 0;
  21.        while(i <= 127 && cnt > 0){ tbuff[i] = buffer[n];
  22.                i++; cnt--; n++; }
  23.  
  24.        if((flag = bdos(21,fd)) != NULL) {
  25.            *(fd + 40) = flag;
  26.            return(n);
  27.        }
  28.     }
  29.     return(n);
  30. }
  31.  
  32.